package com.ruoyi.task.dynamicSched;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.quartz.QuartzAutoConfiguration;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.util.concurrent.TimeUnit;

/**
 * @Author alison
 * @Date 2024/12/2 1:09
 * @Version 1.0
 * @Description
 */

@PropertySource("classpath:application-sched2.properties")
@EnableScheduling
@ComponentScan(basePackageClasses = {DynamicSchedBoot.class})
@EnableAutoConfiguration(exclude = {QuartzAutoConfiguration.class})
@SpringBootTest
public class DynamicSchedBoot {
    public static void main(String[] args) throws Exception {
        System.setProperty("spring.main.web-application-type", "none");
        System.setProperty("spring.main.allow-bean-definition-overriding", "true");
        System.setProperty("schedule.load.type", "jdbc");
        SpringApplication.run(DynamicSchedBoot.class, args);
        TimeUnit.SECONDS.sleep(20);
    }
}
